package com.tfswx.jcyw.dmzc.action;

import com.intellij.openapi.actionSystem.ActionGroup;
import com.intellij.openapi.actionSystem.ActionManager;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import org.jetbrains.annotations.NotNull;


public final class ZcjlAddGroup extends ActionGroup {

    @Override
    public AnAction @NotNull [] getChildren(AnActionEvent e) {
        return this.getMenuList();
    }

    private AnAction[] getMenuList() {
        String zcjlAddByCodeActionId = "com.tfswx.jcyw.dmzc.action.ZcjlAddAction";
        String zcjlAddByShotActionId = "com.tfswx.jcyw.dmzc.action.ZcjlAddByShotAction";
        ActionManager actionManager = ActionManager.getInstance();
        AnAction zcjlAddByCodeAction = actionManager.getAction(zcjlAddByCodeActionId);
        if (zcjlAddByCodeAction == null) {
            zcjlAddByCodeAction = new ZcjlAddByCodeAction();
            actionManager.registerAction(zcjlAddByCodeActionId, zcjlAddByCodeAction);
        }

//        AnAction zcjlAddByShotAction = actionManager.getAction(zcjlAddByShotActionId);
//        if (zcjlAddByShotAction == null) {
//            zcjlAddByShotAction = new ZcjlAddByShotAction();
//            actionManager.registerAction(zcjlAddByShotActionId, zcjlAddByShotAction);
//        }

        return new AnAction[]{zcjlAddByCodeAction};
    }
}
